<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Migration_add_newsletter_table extends CI_Migration {
	public function up() {
		echo 'Migration 1';
		$this->dbforge->add_field(array(
			'nid' => array(
				'type' => 'INT',
				'auto_increment' => true,
				'unsigned' => true
			),
			'data' => array(
				'type' => 'TEXT'
			),
			'type' => array(
				'type' => 'VARCHAR',
				'constraint' => 128
			),
			'created' => array(
				'type' => 'INT',
				'unsigned' => true
			),
			'status' => array(
				'type' => 'INT',
				'unsigned' => true
			)
		));
		$this->dbforge->add_key('nid', TRUE);
		$this->dbforge->create_table('ci_newsletters');
	}

	public function down() {
		$this->dbforge->drop_table('ci_newsletters');
	}
}